roscpp overview: Initialization and Shutdown | Basics | Advanced: Traits [ROS C Turtle] | Advanced: Custom Allocators [ROS C Turtle] | Advanced: Serialization and Adapting Types [ROS C Turtle] | Publishers and Subscribers | Services | Parameter Server | Timers (Periodic Callbacks) | NodeHandles | Callbacks and Spinning | Logging | Names and Node Information | Time | Exceptions | Compilation Options | Advanced: Internals | tf/Overview | tf/Tutorials | C++ Style Guide

The most common API routines for getting information about your node and working with names are described below.

Accessing Node Information

See also: ros::this_node namespace API docs

ros::this_node::getName()

  • Get the fully-qualified name of this node.

ros::this_node::getNamespace()

  • Get the fully-qualified namespace of this node.

Manipulating Names

See also: ros::names namespace API docs, ros::NodeHandle::resolveName() API docs

std::string ros::NodeHandle::resolveName(const std::string& name, bool remap = true);

  • Resolve a name using the NodeHandle's namespace.

std::string ros::names::resolve(const std::string& name, bool remap = true);

  • Resolve a name using the node's namespace.

std::string ros::names::append(const std::string& left, const std::string& right);

  • Append right to left.

std::string ros::names::clean(const std::string& name);

  • Remove duplicate / characters.

bool ros::names::validate(const std::string& name, std::string& error);

  • Validate a name, returning an error string if invalid.

Wiki: roscpp/Overview/Names and Node Information (last edited 2011-07-13 11:07:52 by ChristianDornhege)